<!DOCTYPE html><html class=split lang=en-US-x-hixie><script src=../link-fixup.js defer=""></script>
<!-- Mirrored from html.spec.whatwg.org/dev/common-dom-interfaces.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 10 Sep 2025 08:36:24 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<meta charset=utf-8><meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name=viewport><title>HTML Standard, Edition for Web Developers</title><meta content=#3c790a name=theme-color><meta content="light dark" name=color-scheme><link rel=stylesheet href=../../resources.whatwg.org/standard-shared-with-dev.css crossorigin=""><link rel=icon href=https://resources.whatwg.org/logo.svg crossorigin=""><link rel=stylesheet href=styles.css crossorigin=""><script>
   function toggleStatus(div) {
     div.parentNode.classList.toggle('wrapped');
   }
   function setLinkFragment(link) {
     link.hash = location.hash;
   }
  </script><body>
  <script async="" src=search.js></script>
  
  
  <header id=head class="head with-buttons">
   <a href=https://whatwg.org/ class=logo><img width=100 alt=WHATWG crossorigin="" class=darkmode-aware src=https://resources.whatwg.org/logo.svg height=100></a>
   
   <hgroup><h1><a rel=home href=index.html>HTML: The Living Standard</a></h1><p id=dev-edition-h2>Edition for Web Developers — Last Updated <span class=pubdate>10 September 2025</span></hgroup>
   

   <div id=search>
    <input placeholder="Search. Press '/'" autocomplete=off name=query id=query type=search>
    <ol id=results></ol>
   </div>
  </header>

  

  

  

  
  

  
  

  

  <nav><a href=urls-and-fetching.html>← 2.4 URLs</a> — <a href=index.html>Table of Contents</a> — <a href=structured-data.html>2.6 Safe passing of structured data →</a></nav><ol class=toc><li><ol><li><a href=common-dom-interfaces.html#common-dom-interfaces><span class=secno>2.5</span> Common DOM interfaces</a><ol><li><a href=common-dom-interfaces.html#reflecting-content-attributes-in-idl-attributes><span class=secno>2.5.1</span> Reflecting content attributes in IDL attributes</a><li><a href=common-dom-interfaces.html#collections><span class=secno>2.5.2</span> Collections</a><ol><li><a href=common-dom-interfaces.html#the-htmlallcollection-interface><span class=secno>2.5.2.1</span> The <code>HTMLAllCollection</code> interface</a><li><a href=common-dom-interfaces.html#the-htmlformcontrolscollection-interface><span class=secno>2.5.2.2</span> The <code>HTMLFormControlsCollection</code> interface</a><li><a href=common-dom-interfaces.html#the-htmloptionscollection-interface><span class=secno>2.5.2.3</span> The <code>HTMLOptionsCollection</code> interface</a></ol><li><a href=common-dom-interfaces.html#the-domstringlist-interface><span class=secno>2.5.3</span> The <code>DOMStringList</code> interface</a></ol></ol></ol><h3 id=common-dom-interfaces><span class=secno>2.5</span> Common DOM interfaces<a href=#common-dom-interfaces class=self-link></a></h3>

  <h4 id=reflecting-content-attributes-in-idl-attributes><span class=secno>2.5.1</span> Reflecting content attributes in IDL attributes<a href=#reflecting-content-attributes-in-idl-attributes class=self-link></a></h4>

  <p>The building blocks for reflecting are as follows:</p>

  <ul><li><p>A <dfn id=reflected-target>reflected target</dfn> is an element or <code>ElementInternals</code>
   object. It is typically clear from context and typically identical to the interface of the
   <a href=#reflected-idl-attribute id=reflecting-content-attributes-in-idl-attributes:reflected-idl-attribute>reflected IDL attribute</a>. It is always identical to that interface when it is an
   <code>ElementInternals</code> object.<li><p>A <dfn id=reflected-idl-attribute>reflected IDL attribute</dfn> is an attribute interface member.<li><p>A <dfn id=reflected-content-attribute-name>reflected content attribute name</dfn> is a string. When the <a href=#reflected-target id=reflecting-content-attributes-in-idl-attributes:reflected-target>reflected
   target</a> is an element, it represents the local name of a content attribute whose namespace
   is null. When the <a href=#reflected-target id=reflecting-content-attributes-in-idl-attributes:reflected-target-2>reflected target</a> is an <code>ElementInternals</code> object, it
   represents a key of the <a href=#reflected-target id=reflecting-content-attributes-in-idl-attributes:reflected-target-3>reflected target</a>'s <span>target
   element</span>'s <span>internal content attribute map</span>.</ul>

  <p>A <a href=#reflected-idl-attribute id=reflecting-content-attributes-in-idl-attributes:reflected-idl-attribute-2>reflected IDL attribute</a> can be defined to <dfn id=reflect data-export="">reflect</dfn> a
  <a href=#reflected-content-attribute-name id=reflecting-content-attributes-in-idl-attributes:reflected-content-attribute-name>reflected content attribute name</a> of a <a href=#reflected-target id=reflecting-content-attributes-in-idl-attributes:reflected-target-4>reflected target</a>. In general this
  means that the IDL attribute getter returns the current value of the content attribute, and the
  setter changes the value of the content attribute to the given value.</p>

  

  <h4 id=collections><span class=secno>2.5.2</span> Collections<a href=#collections class=self-link></a></h4>

  <p>The <code>HTMLFormControlsCollection</code> and <code>HTMLOptionsCollection</code> interfaces
  are <a href=https://dom.spec.whatwg.org/#concept-collection id=collections:concept-collection data-x-internal=concept-collection>collections</a> derived from the
  <code id=collections:htmlcollection><a data-x-internal=htmlcollection href=https://dom.spec.whatwg.org/#interface-htmlcollection>HTMLCollection</a></code> interface. The <code>HTMLAllCollection</code> interface is a <a href=https://dom.spec.whatwg.org/#concept-collection id=collections:concept-collection-2 data-x-internal=concept-collection>collection</a>, but is not so derived.</p>


  <h5 id=the-htmlallcollection-interface><span class=secno>2.5.2.1</span> The <code>HTMLAllCollection</code> interface<a href=#the-htmlallcollection-interface class=self-link></a></h5>

  <p>The <code>HTMLAllCollection</code> interface is used for the legacy <code>document.all</code> attribute. It operates similarly to
  <code id=the-htmlallcollection-interface:htmlcollection><a data-x-internal=htmlcollection href=https://dom.spec.whatwg.org/#interface-htmlcollection>HTMLCollection</a></code>; the main differences are that it allows a staggering variety of
  different (ab)uses of its methods to all end up returning something, and that it can be called as
  a function as an alternative to property access.</p>

  <p class=note>All <code>HTMLAllCollection</code> objects are rooted at a <code>Document</code>
  and have a filter that matches all elements, so the elements <a id=the-htmlallcollection-interface:represented-by-the-collection href=https://dom.spec.whatwg.org/#represented-by-the-collection data-x-internal=represented-by-the-collection>represented by the
  collection</a> of an <code>HTMLAllCollection</code> object consist of all the descendant
  elements of the root <code>Document</code>.</p>

  

  <div class=note>
   <p>Objects that implement the <code>HTMLAllCollection</code> interface have several unusual
   behaviors, due of the fact that they have an <a id=the-htmlallcollection-interface:ishtmldda href=https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot data-x-internal=ishtmldda>[[IsHTMLDDA]]</a> internal slot:</p>

   <ul><li><p>The <a href=https://tc39.es/ecma262/#sec-toboolean id=the-htmlallcollection-interface:js-toboolean data-x-internal=js-toboolean>ToBoolean</a> abstract operation in JavaScript returns
    false when given objects implementing the <code>HTMLAllCollection</code> interface.<li><p>The <a href=https://tc39.es/ecma262/#sec-islooselyequal id=the-htmlallcollection-interface:js-abstract-equality data-x-internal=js-abstract-equality>IsLooselyEqual</a> abstract operation,
    when given objects implementing the <code>HTMLAllCollection</code> interface, returns true when
    compared to the <code>undefined</code> and <code>null</code> values.
    (Comparisons using the <a href=https://tc39.es/ecma262/#sec-isstrictlyequal id=the-htmlallcollection-interface:js-strict-equality data-x-internal=js-strict-equality>IsStrictlyEqual</a> abstract
    operation, and IsLooselyEqual comparisons to other values such as strings or objects, are
    unaffected.)<li><p>The <code id=the-htmlallcollection-interface:js-typeof><a data-x-internal=js-typeof href=https://tc39.es/ecma262/#sec-typeof-operator>typeof</a></code> operator in JavaScript returns the string
    <code>"undefined"</code> when applied to objects implementing the
    <code>HTMLAllCollection</code> interface.</ul>

   <p>These special behaviors are motivated by a desire for compatibility with two classes of legacy
   content: one that uses the presence of <code>document.all</code> as a
   way to detect legacy user agents, and one that only supports those legacy user agents and uses
   the <code>document.all</code> object without testing for its presence
   first. <a href=references.html#refsJAVASCRIPT>[JAVASCRIPT]</a></p>
  </div>

  

  


  <h5 id=the-htmlformcontrolscollection-interface><span class=secno>2.5.2.2</span> The <code>HTMLFormControlsCollection</code> interface<a href=#the-htmlformcontrolscollection-interface class=self-link></a></h5>

  <p>The <code>HTMLFormControlsCollection</code> interface is used for
  <a href=https://dom.spec.whatwg.org/#concept-collection id=the-htmlformcontrolscollection-interface:concept-collection data-x-internal=concept-collection>collections</a> of <a href=forms.html#category-listed id=the-htmlformcontrolscollection-interface:category-listed>listed
  elements</a> in <code id=the-htmlformcontrolscollection-interface:the-form-element><a href=forms.html#the-form-element>form</a></code> elements.</p>

  

  <dl class=domintro><dt><code><var>collection</var>.<a href=https://dom.spec.whatwg.org/#dom-htmlcollection-length id=dom-htmlcollection-length-2 data-x-internal=dom-htmlcollection-length>length</a></code><dd><p>Returns the number of elements in <var>collection</var>.<dt><code><var>element</var> = <var>collection</var>.<a href=https://dom.spec.whatwg.org/#dom-htmlcollection-item id=dom-htmlcollection-item-2 data-x-internal=dom-htmlcollection-item>item</a>(<var>index</var>)</code><dt><code><var>element</var> = <var>collection</var>[<var>index</var>]</code><dd><p>Returns the item at index <var>index</var> in <var>collection</var>. The items are sorted
   in <a id=the-htmlformcontrolscollection-interface:tree-order href=https://dom.spec.whatwg.org/#concept-tree-order data-x-internal=tree-order>tree order</a>.<dt><code><var>element</var> = <var>collection</var>.<span id=dom-htmlformcontrolscollection-nameditem>namedItem</span>(<var>name</var>)</code><dt><code><var>radioNodeList</var> = <var>collection</var>.<a href=#dom-htmlformcontrolscollection-nameditem id=the-htmlformcontrolscollection-interface:dom-htmlformcontrolscollection-nameditem>namedItem</a>(<var>name</var>)</code><dt><code><var>element</var> = <var>collection</var>[<var>name</var>]</code><dt><code><var>radioNodeList</var> = <var>collection</var>[<var>name</var>]</code><dd>
    <p>Returns the item with <a href=https://dom.spec.whatwg.org/#concept-id id=the-htmlformcontrolscollection-interface:concept-id data-x-internal=concept-id>ID</a> or <code id=the-htmlformcontrolscollection-interface:attr-fe-name><a href=form-control-infrastructure.html#attr-fe-name>name</a></code> <var>name</var> from <var>collection</var>.</p>

    <p>If there are multiple matching items, then a <code>RadioNodeList</code> object containing all
    those elements is returned.</p>
   <dt><code><var>radioNodeList</var>.<span id=dom-radionodelist-value>value</span></code><div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/RadioNodeList/value title="If the underlying element collection contains radio buttons, the RadioNodeList.value property represents the checked radio button. On retrieving the value property, the value of the currently checked radio button is returned as a string. If the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned. On setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked.">RadioNodeList/value</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>33+</span></span><span class="safari yes"><span>Safari</span><span>7+</span></span><span class="chrome yes"><span>Chrome</span><span>21+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><dd><p>Returns the value of the first checked radio button represented by
   <var>radioNodeList</var>.<dt><code><var>radioNodeList</var>.<a href=#dom-radionodelist-value id=the-htmlformcontrolscollection-interface:dom-radionodelist-value>value</a> = <var>value</var></code><dd><p>Checks the first radio button represented by <var>radioNodeList</var> that has value
   <var>value</var>.</dl>

  


  <h5 id=the-htmloptionscollection-interface><span class=secno>2.5.2.3</span> The <code>HTMLOptionsCollection</code> interface<a href=#the-htmloptionscollection-interface class=self-link></a></h5><div class="mdn-anno wrapped"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection title="The HTMLOptionsCollection interface represents a collection of <option> HTML elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items. This object is returned only by the options property of select.">HTMLOptionsCollection</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>6+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>1+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div>

  <p>The <code>HTMLOptionsCollection</code> interface is used for <a href=https://dom.spec.whatwg.org/#concept-collection id=the-htmloptionscollection-interface:concept-collection data-x-internal=concept-collection>collections</a> of <code id=the-htmloptionscollection-interface:the-option-element><a href=form-elements.html#the-option-element>option</a></code> elements. It is always
  rooted on a <code id=the-htmloptionscollection-interface:the-select-element><a href=form-elements.html#the-select-element>select</a></code> element and has attributes and methods that manipulate that
  element's descendants.</p>

  

  <dl class=domintro><dt><code><var>collection</var>.<span id=dom-htmloptionscollection-length>length</span></code><dd><p>Returns the number of elements in <var>collection</var>.<dt><code><var>collection</var>.<a href=#dom-htmloptionscollection-length id=the-htmloptionscollection-interface:dom-htmloptionscollection-length>length</a> = <var>value</var></code><dd>
    <p>When set to a smaller number than the existing length, truncates the number of
    <code id=the-htmloptionscollection-interface:the-option-element-2><a href=form-elements.html#the-option-element>option</a></code> elements in the container corresponding to <var>collection</var>.</p>

    <p>When set to a greater number than the existing length, if that number is less than or equal
    to 100000, adds new blank <code id=the-htmloptionscollection-interface:the-option-element-3><a href=form-elements.html#the-option-element>option</a></code> elements to the container corresponding to
    <var>collection</var>.</p>
   <dt><code><var>element</var> = <var>collection</var>.<a href=https://dom.spec.whatwg.org/#dom-htmlcollection-item id=the-htmloptionscollection-interface:dom-htmlcollection-item data-x-internal=dom-htmlcollection-item>item</a>(<var>index</var>)</code><dt><code><var>element</var> = <var>collection</var>[<var>index</var>]</code><dd><p>Returns the item at index <var>index</var> in <var>collection</var>. The items are sorted
   in <a id=the-htmloptionscollection-interface:tree-order href=https://dom.spec.whatwg.org/#concept-tree-order data-x-internal=tree-order>tree order</a>.<dt><code><var>collection</var>[<var>index</var>] = <var>element</var></code><dd>
    <p>When <var>index</var> is a greater number than the number of items in <var>collection</var>,
    adds new blank <code id=the-htmloptionscollection-interface:the-option-element-4><a href=form-elements.html#the-option-element>option</a></code> elements in the corresponding container.</p>

    <p>When set to null, removes the item at index <var>index</var> from <var>collection</var>.</p>

    <p>When set to an <code id=the-htmloptionscollection-interface:the-option-element-5><a href=form-elements.html#the-option-element>option</a></code> element, adds or replaces it at index <var>index</var> in
    <var>collection</var>.</p>
   <dt><code><var>element</var> = <var>collection</var>.<a href=https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem id=dom-htmlcollection-nameditem-2 data-x-internal=dom-htmlcollection-nameditem>namedItem</a>(<var>name</var>)</code><dt><code><var>element</var> = <var>collection</var>[<var>name</var>]</code><dd>
    <p>Returns the item with <a href=https://dom.spec.whatwg.org/#concept-id id=the-htmloptionscollection-interface:concept-id data-x-internal=concept-id>ID</a> or <code id=the-htmloptionscollection-interface:attr-option-name><a href=obsolete.html#attr-option-name>name</a></code> <var>name</var> from <var>collection</var>.</p>

    <p>If there are multiple matching items, then the first is returned.</p>
   <dt><code><var>collection</var>.<span id=dom-htmloptionscollection-add>add</span>(<var>element</var>[, <var>before</var>])</code><dd>
    <p>Inserts <var>element</var> before the node given by <var>before</var>.</p>

    <p>The <var>before</var> argument can be a number, in which case <var>element</var> is inserted
    before the item with that number, or an element from <var>collection</var>, in which case
    <var>element</var> is inserted before that element.</p>

    <p>If <var>before</var> is omitted, null, or a number out of range, then <var>element</var> will
    be added at the end of the list.</p>

    <p>Throws a <a id=the-htmloptionscollection-interface:hierarchyrequesterror href=https://webidl.spec.whatwg.org/#hierarchyrequesterror data-x-internal=hierarchyrequesterror>"<code>HierarchyRequestError</code>"</a> <code id=the-htmloptionscollection-interface:domexception><a data-x-internal=domexception href=https://webidl.spec.whatwg.org/#dfn-DOMException>DOMException</a></code> if
    <var>element</var> is an ancestor of the element into which it is to be inserted.</p>
   <dt><code><var>collection</var>.<span id=dom-htmloptionscollection-remove>remove</span>(<var>index</var>)</code><dd><p>Removes the item with index <var>index</var> from <var>collection</var>.<dt><code><var>collection</var>.<a href=#dom-htmloptionscollection-selectedindex id=the-htmloptionscollection-interface:dom-htmloptionscollection-selectedindex>selectedIndex</a></code><dd><p>Returns the index of the first selected item, if any, or −1 if there is no selected
   item.<dt><code><var>collection</var>.<span id=dom-htmloptionscollection-selectedindex>selectedIndex</span> = <var>index</var></code><dd><p>Changes the selection to the <code id=the-htmloptionscollection-interface:the-option-element-6><a href=form-elements.html#the-option-element>option</a></code> element at index <var>index</var> in
   <var>collection</var>.</dl>

  


  <h4 id=the-domstringlist-interface><span class=secno>2.5.3</span> The <code>DOMStringList</code> interface<a href=#the-domstringlist-interface class=self-link></a></h4><div class="mdn-anno wrapped"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/DOMStringList title="The DOMString interface is a legacy type returned by some APIs and represents a non-modifiable list of strings (DOMString). Modern APIs use Array objects (in WebIDL: sequence<DOMString>) instead.">DOMStringList</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>10+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>3+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div>

  <p>The <code>DOMStringList</code> interface is a non-fashionable retro way of representing a list
  of strings.</p>

  

  

  <dl class=domintro><dt><code><var>strings</var>.<span id=dom-domstringlist-length>length</span></code><div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/DOMStringList/length title="The read-only length property indicates the number of strings in the DOMStringList.">DOMStringList/length</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>10+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><dd><p>Returns the number of strings in <var>strings</var>.<dt><code><var>strings</var>[<var>index</var>]</code><dt><code><var>strings</var>.<span id=dom-domstringlist-item>item</span>(<var>index</var>)</code><div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/DOMStringList/item title="The item() method returns a string from a DOMStringList by index.">DOMStringList/item</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>10+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>3+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><dd><p>Returns the string with index <var>index</var> from <var>strings</var>.<dt><code><var>strings</var>.<span id=dom-domstringlist-contains>contains</span>(<var>string</var>)</code><div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/DOMStringList/contains title="The contains() method returns a boolean indicating whether the given string is in the list.">DOMStringList/contains</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1.5+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>10+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>3+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><dd><p>Returns true if <var>strings</var> contains <var>string</var>, and false
   otherwise.</dl>

  


  <nav><a href=urls-and-fetching.html>← 2.4 URLs</a> — <a href=index.html>Table of Contents</a> — <a href=structured-data.html>2.6 Safe passing of structured data →</a></nav>
